import EventName from "./EventName";


const { ccclass, property } = cc._decorator;

@ccclass
export default class ChooseEventItem extends cc.Component {

    @property(cc.Label)
    lbBehavior: cc.Label = null;

    private _chooseIndex = 0;
    private _chooseData = null;

    init(i, data) {
        this._chooseIndex = i;
        this._chooseData = data;

        this.updateUI();
    }

    private updateUI() {
        this.lbBehavior.string = this._chooseData.behavior;
    }

    private onClickChoose() {
        cc.director.getScene().emit(EventName.CHOOSE_BEHAVIOR, this._chooseIndex);
    }


}
